<template>
	<view class="wap">
		<navbar :parameter='parameter'></navbar>
		<view class="box" v-if="name == 'yhxz'">
			<view class="title">{{detail.yhxz.title}}</view>
			<view class="content">
				<u-parse :content="detail.yhxz.content"></u-parse>
			</view>
		</view>
		<view class="box" v-if="name == 'mzsm'">
			<view class="title">{{detail.mzsm.title}}</view>
			<view class="content">
				<u-parse :content="detail.mzsm.content"></u-parse>
			</view>
		</view>
		<view class="box" v-if="name == 'yssm'">
			<view class="title">{{detail.yssm.title}}</view>
			<view class="content">
				<u-parse :content="detail.yssm.content"></u-parse>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				parameter: {
					'navbar': '1',
					'return': '1',
					'title': '平台动态',
					'color': true,
					'class': 'on'
				},
				detail: {},
				name: ''
			};
		},
		onLoad(option) {
			console.log(option)
			this.name = option.name;
			this.info();
		


		},
		onShow() {

		},
		/**
		 * 用户点击右上角分享
		 */
		onShareAppMessage: function() {
		
		},
		onShareTimeline(res) { //分享到朋友圈
		
		},
		methods: {
			async info() {
				var that = this;
				const res = await this.$myRequest({
					url: '/api/index/getArticleOne',
					data: {
						openid: uni.getStorageSync('openid'),
					}
				})
				console.log(res.data.data)
				this.detail = res.data.data;
				if (that.name == 'yhxz') {
					that.parameter.title =  res.data.data.yhxz.title;
				} else if (that.name == 'mzsm') {
					that.parameter.title = res.data.data.mzsm.title;
				} else {
					that.parameter.title = res.data.data.yssm.title;
				}
			},
		}
	}
</script>

<style lang="scss">
	.wap {
		padding: 30rpx;
	}

	.box {
		padding: 30rpx;
		background-color: #fff;
		border-radius: 12rpx;
	}


	.wap .title {
		font-size: 32rpx;
		color: #333;
		font-weight: 700;
		line-height: 1.6;
		text-align: center;
	}

	.wap .content {
		padding-top: 30rpx;
	}
</style>
